home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / SpinFetchAndOp.h,v < prev    next >
Text File  |  1989-02-23  |  2KB  |  182 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.37.38;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.50.20;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.3;
  18.  
  19. 1.3
  20. date     88.10.30.13.06.09;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.2;
  23.  
  24. 1.2
  25. date     88.09.28.22.13.44;  author grunwald;  state Exp;
  26. branches ;
  27. next     1.1;
  28.  
  29. 1.1
  30. date     88.09.21.20.51.47;  author grunwald;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39. 3.2
  40. log
  41. @Start using Gnu library heaps for schedulers
  42. @
  43. text
  44. @// This may look like C code, but it is really -*- C++ -*-
  45. // 
  46. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  47. //
  48. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  49. //
  50. #ifndef SpinFetchAndOp_h
  51. #define SpinFetchAndOp_h
  52. //
  53. //    Fetch and op for hardware CPUS
  54. //
  55.  
  56. #include "SpinLock.h"
  57. #include "Config.h"
  58.  
  59. class SpinFetchAndOp : public SpinLock {
  60.     int    data;
  61. public:
  62.     SpinFetchAndOp(int);
  63.     void set(int);
  64.     int add(int);
  65.     int unlockedAdd(int);
  66.     int value();
  67. };
  68.  
  69. inline
  70. SpinFetchAndOp::SpinFetchAndOp(int d)
  71. {
  72.     data = d;
  73. }
  74.  
  75. inline void
  76. SpinFetchAndOp::set(int d)
  77. {
  78.     data = d ;
  79. }
  80.  
  81. #ifndef USE_SHARED_MEMORY
  82.   inline int
  83.   SpinFetchAndOp::add(int d)
  84.   {
  85.     int was = data;
  86.     data += d;
  87.     return(was);
  88.   }
  89. #endif
  90.  
  91. inline int
  92. SpinFetchAndOp::unlockedAdd(int d)
  93. {
  94.     int was = data;
  95.     data += d;
  96.     return(was);
  97. }
  98.  
  99. inline int
  100. SpinFetchAndOp::value()
  101. {
  102.     return(data);
  103. }
  104. #endif /* SpinFetchAndOp_h */
  105. @
  106.  
  107.  
  108. 3.1
  109. log
  110. @Steay version
  111. @
  112. text
  113. @@
  114.  
  115.  
  116. 1.3
  117. log
  118. @*** empty log message ***
  119. @
  120. text
  121. @@
  122.  
  123.  
  124. 1.2
  125. log
  126. @*** empty log message ***
  127. @
  128. text
  129. @d1 3
  130. a3 2
  131. #ifndef HardFetchAndOp_h
  132. #define HardFetchAndOp_h
  133. d5 5
  134. d13 2
  135. a14 1
  136. #include "HardSpinLock.h"
  137. d16 1
  138. a16 1
  139. class HardFetchAndOp : public HardSpinLock {
  140. d19 1
  141. a19 1
  142.     HardFetchAndOp(int);
  143. d27 1
  144. a27 1
  145. HardFetchAndOp::HardFetchAndOp(int d)
  146. d33 1
  147. a33 1
  148. HardFetchAndOp::set(int d)
  149. d38 9
  150. d49 1
  151. a49 1
  152. HardFetchAndOp::unlockedAdd(int d)
  153. d57 1
  154. a57 1
  155. HardFetchAndOp::value()
  156. d61 1
  157. a61 1
  158. #endif /* HardFetchAndOp_h */
  159. @
  160.  
  161.  
  162. 1.1
  163. log
  164. @Initial revision
  165. @
  166. text
  167. @d19 1
  168. d25 1
  169. a25 1
  170. void
  171. d31 2
  172. a32 1
  173. int
  174. d35 1
  175. d37 1
  176. a37 1
  177.     return(data);
  178. d40 1
  179. a40 1
  180. int
  181. @
  182.